package br.com.gerenciamento.pg.framework.mail;

import java.util.HashMap;
import java.util.Map;

import org.joda.time.DateTime;



public class DefaultEmailMessage implements EmailMessage {
	private static final long serialVersionUID = 1L;

	protected String from;
	protected String fromName;
	protected String to;
	protected String subject;
	protected String bcc;
	protected String replyTo;
	protected String templateLocation;

	public DefaultEmailMessage(String templateLocation) {
		this.templateLocation = templateLocation;
	}	
	
	public Map<String, Object> toMap() {
		final Map<String, Object> map = new HashMap<String, Object>();
		map.put("from", getFrom());
		map.put("fromName", getFromName());
		map.put("to", getTo());
		map.put("subject", getSubject());
		map.put("year", new DateTime().getYear());
		map.put("self", this);
		return map;
	}
	
	public boolean isAsync() {
		return true;
	}
	
	public String getFrom() {
		return from;
	}

	public void setFrom(String from) {
		this.from = from;
	}

	public String getFromName() {
		return fromName;
	}

	public void setFromName(String fromName) {
		this.fromName = fromName;
	}

	public String getTo() {
		return to;
	}

	public void setTo(String to) {
		this.to = to;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public String getBcc() {
		return bcc;
	}

	public void setBcc(String bcc) {
		this.bcc = bcc;
	}

	public String getReplyTo() {
		return replyTo;
	}

	public void setReplyTo(String replyTo) {
		this.replyTo = replyTo;
	}

	public String getTemplateLocation() {
		return templateLocation;
	}

	public void setTemplateLocation(String templateLocation) {
		this.templateLocation = templateLocation;
	}

}
